package milk.core
{
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	
	import milk.ui.Loading;
	
	public class Application extends Sprite
	{
		public var pop:Sprite;
		public var main:Sprite;
		
		private var cls:Class;
		public function Application(cls:Class,stage:Stage)
		{
			super();
			
			stage.align=StageAlign.TOP_LEFT;
			stage.scaleMode=StageScaleMode.NO_SCALE;
			
			
			this.cls=cls;
			this.addChild(this);
			
			stage.addEventListener(Event.ENTER_FRAME,enterHandler);
		}
		
		private function enterHandler(event:Event):void{
			if(stage.stageWidth>0){
				stage.removeEventListener(Event.ENTER_FRAME,enterHandler);
			}
			
			
			
			stage.addChild(this);
			
			
			pop=new Sprite();
			pop.mouseEnabled=false;
			
			main=new Sprite();
			main.mouseEnabled=false;
			
		}
	}
}